Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mrp_sale_info: Materialize link between sale order lines and created MOs #1353

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

SirAionTech
Copy link

Forward port of #1298 and #1337.

@SirAionTech SirAionTech force-pushed the 16.0-imp-mrp_sale_info-link_sale_line branch from 77cd0be to d7e675d Compare September 17, 2024 12:40
@SirAionTech
Copy link
Author

@grindtildeath @sebalix @ajaniszewska-dev @JuMiSanAr @pedrobaeza maybe you want to have a look since you worked in the linked PRs?

I just edited a bit the commit messages in order to follow https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#71commit-message.

@SirAionTech SirAionTech marked this pull request as ready for review September 17, 2024 12:43
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has provoked is done headaches, as the compute is launched on update time

@SirAionTech
Copy link
Author

Thanks for the review!

This has provoked is done headaches, as the compute is launched on update time

I guess that's the usual behavior when a new stored computed field is added, why is this case different?
Sorry I didn't know about the headaches, I can't find any reference to this in the linked PRs.

@pedrobaeza
Copy link
Member

I mean that you should provide a init hook or auto_init override for pre-creating the DB schema and fast-populate data for existing records.

@SirAionTech
Copy link
Author

I mean that you should provide a init hook or auto_init override for pre-creating the DB schema and fast-populate data for existing records.

Thanks for the hint, so at upgrade time the computed fields should be populated with an optimized calculation (you mean like SQL queries?) instead of letting the field compute itself, did I understand that correctly?

@pedrobaeza
Copy link
Member

Correct.

@SirAionTech
Copy link
Author

I tried to do a SQL query for computing all the values in _auto_init but it's a hell of relations of *2many fields (created_production_ids, move_orig_ids, mrp_production_ids); I tried to optimize the compute method itself, would you have another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants